for i in range(20):
    print(f"CREATE TABLE `cc_res_tag_relation_2018_{i}` (")
    print("  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',")
    print("  `res_id` varchar(32) NOT NULL DEFAULT '' COMMENT '资源id',")
    print("  `res_type` varchar(45) NOT NULL DEFAULT '' COMMENT '资源名称: movie, music,people',")
    print("  `tag_name` text COMMENT '标签中文名称,多个使用逗号号分隔',")
    print("  `tag_weight` text COMMENT '标签权重分',")
    print("  `remove_tag_name` varchar(400) DEFAULT '' COMMENT '删除的标签code，多个用逗号分隔',")
    print("  `status` int(4) NOT NULL DEFAULT '0' COMMENT '状态 0 无效 1 有效;',")
    print("  `ext_param` text COMMENT '扩展字段',")
    print("  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',")
    print("  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',")
    print("  PRIMARY KEY (`id`) USING BTREE,")
    print("  UNIQUE KEY `idx_res_id` (`res_id`) USING BTREE,")
    print("  KEY `idx_update_time` (`update_time`) USING BTREE")
    print(f") ENGINE=InnoDB COMMENT='资源与标签的关联表';\n")

for i in range(20):
    print(f"CREATE TABLE `cc_res_tag_relation_record_2018_{i}` (")
    print("  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',")
    print("  `res_id` varchar(32) NOT NULL DEFAULT '' COMMENT '资源id',")
    print("  `res_type` varchar(45) NOT NULL DEFAULT '' COMMENT '资源类型: movie, music,people',")
    print("  `tag_name` text COMMENT '标签名称,多个用逗号隔开',")
    print("  `tag_weight` text COMMENT '标签权重分',")
    print("  `source` varchar(32) DEFAULT '' COMMENT '资源标签来源',")
    print("  `status` int(4) NOT NULL DEFAULT '0' COMMENT '状态 0 无效 1 有效;',")
    print("  `ext_param` text COMMENT '扩展字段',")
    print("  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',")
    print("  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',")
    print("  PRIMARY KEY (`id`) USING BTREE,")
    print("  KEY `idx_res_id` (`res_id`) USING BTREE,")
    print("  KEY `idx_update_time` (`update_time`) USING BTREE")
    print(f") ENGINE=InnoDB COMMENT='资源与标签的关联记录表';\n")